angular.module("ishop.myController", [])
    //个人中心
    .controller('MyAction', function ($scope,$rootScope,MyService,Storage,ENV) {
        //注销
        $scope.logout = function(){
            Storage.remove(ENV.accessToken);
            $scope.accessToken = Storage.get(ENV.accessToken);
        };

        //登录
        $scope.loginData = {};
        $scope.doLogin = function(){
            //登录逻辑
            Storage.set(ENV.accessToken,"qintao");
            $scope.accessToken = Storage.get(ENV.accessToken);

        };
        $scope.accessToken = Storage.get(ENV.accessToken);
    })

    .controller('MyOrderAction',function($scope,MyService,Storage,ENV){
        $scope.orders = MyService.all();

    })

    .controller('MyOrderDetailAction',function($scope,$stateParams,MyService,Storage,ENV){

        $scope.goods = MyService.get($stateParams.id);
    })

;